package com.klangner.go.app.rules;

import com.klangner.go.app.strategy.BasicAtariGoMoveSelector;
import com.klangner.go.app.strategy.IGoStrategy;
import com.klangner.go.model.Move;

public class AtariGoMinMaxPlayer extends Player {

  public AtariGoMinMaxPlayer(int color, IGoStrategy strategy) {
    super(color);
    this.strategy = strategy;
  }

  // override Player's initPlayer method
  public void initPlayer() {}

  // override Player's move method
  protected Move move(BoardModel goPosition) {
    Move nextMove;

    if ((nextMove = BasicAtariGoMoveSelector.tryBasicMove(goPosition)) == null)
      return strategy.chooseNextMove(goPosition);
    else
      return nextMove;
  }
}